<script setup lang="ts">
import dept from "@/components/my/dept.vue";
import previewImg from "@/components/my/previewImg.vue";
type Props = {
  isDialog?: boolean;
};
let props = withDefaults(defineProps<Props>(), {
  isDialog: false,
});
const emits = defineEmits<{
  (e: "update:isDialog", value: boolean): void;
}>();
</script>

<template>
  <div
    class="dialogs"
    :style="{
      display: isDialog ? 'flex' : 'none',
    }"
  >
    <div class="content">
      <!-- 关闭投诉窗口 -->
      <div class="header">
        <span class="headerTitle">投诉记录详情</span>
        <img
          class="closeBtn"
          src="@/assets/my/close.png"
          alt="关闭"
          @click="emits('update:isDialog', false)"
        />
      </div>
      <!-- 内容标题 -->
      <div class="title">关于广西中小企业的问题</div>
      <!-- 用户头像发布时间 -->
      <div class="userNameTime">
        <img class="user" src="@/assets/my/user.png" alt="头像" />
        <span class="nickName">用户名5646728</span>
        <span class="time">发布于2022年11月08日 10:00:00</span>
      </div>
      <!-- 投诉类型 -->
      <div class="tips">
        <span>[投诉类型]</span>
        <span>融资问题</span>
      </div>
      <!-- 行业类别 -->
      <div class="tips">
        <span>[行业类别]</span>
        <span>机构组织</span>
      </div>
      <!-- 受理状态 -->
      <div class="handle tips">
        <span>[受理状态]</span>
        <span class="state">已完成</span>
      </div>
      <div class="deptLine">
        <div class="line"></div>
        <dept
          content="文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述。"
        />
        <dept
          content="您好！很抱歉给您带来不便，您的问题已反馈至相关部门核实处理，请您耐心等待处理结果，真的谢谢。"
        />
        <dept
          name="用户24867384"
          handleType="投诉"
          :imgs="[
            'https://nntz.jyhdkj.com/pc/src/assets/my/bg1.png',
            'https://nntz.jyhdkj.com/pc/src/assets/my/bg1.png',
          ]"
          content="文字描述最多展示5行，超过点击展开查看全部。文字描述最多展示5行，超过点击展开查看全部。文字描述最多展示5行，超过点击展开查看全部。文字描述最多展示5行，超过点击展开查看全部。文字描述最多展示5行，超过点击展开查看全部。文字描述最多展示5行，超过点击展开查看全部。文字描述最多展示5行，超过点击展开查看全部。文字描述最多展示5行，超过点击展开查看全部。文字描述最多展示5行，超过点击展开查看全部。文字描述最多展示5行，超过点击展开查看全部。文字描述最多展示5行，超过点击展开查看全部。文字描述最多展示5行，超过点击…"
        />
      </div>

      <div class="footer">
        <a class="res">对受理结果不满意？可在30日内再办</a>
        <button class="btn">再办</button>
      </div>
    </div>

    <!-- 预览图片功能 -->
    <!-- <previewImg /> -->
  </div>
</template>

<style scoped lang="scss">
.dialogs {
  position: absolute;
  z-index: 9999;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.49);
  justify-content: center;
  align-items: center;
}

.content {
  width: 800px;
  min-height: 874px;
  background-color: #fff;
  padding: 24px;
  border-radius: 4px;
}

.header {
  width: 100%;
  font-size: 16px;
  font-family: PingFangSC-Semibold, PingFang SC;
  font-weight: 600;
  color: #303133;
  @include flexBetweenCenter;

  .headerTitle {
    @include flexCenter;
    &::before {
      content: "";
      display: inline-block;
      width: 4px;
      height: 14px;
      background: #0066cc;
      border-radius: 1px;
      margin-right: 4px;
    }
  }

  .closeBtn {
    width: 16px;
    height: 16px;
    cursor: pointer;
  }
}

// 内容标题
.title {
  font-size: 22px;
  font-weight: 600;
  color: #333333;
  line-height: 30px;
  margin: 24px 0px;
}

// 用户发布时间
.userNameTime {
  display: flex;
  gap: 0px 10px;
  margin-bottom: 24px;

  .nickName {
    font-size: 16px;
  }

  .user {
    width: 20px;
    height: 20px;
    border-radius: 50%;
  }

  .time {
    @include flexCenter;
    font-size: 12px;
    font-weight: 400;
    color: #90949e;
  }
}

.tips {
  @include flexCenter;
  gap: 0px 10px;
  margin-top: 10px;

  > span:first-child {
    color: #333333;
  }

  > span:last-child {
    color: #606266;
  }
  .state {
    width: 52px;
    height: 20px;
    text-align: center;
    background-color: #f6ffed !important;
    border-radius: 2px;
    border: 1px solid #b7eb8f;
    color: #52c41a !important;
    font-size: 12px;
  }
}

.deptLine {
  margin-top: 24px;
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
  position: relative;
}
.deptLine div:nth-of-type(2)::before {
  background-color: #2163e0 !important;
}

.line {
  position: absolute;
  top: 35px;
  bottom: 25px;
  left: 0;
  width: 1px;
  background-color: #2163e0;
}

.footer {
  @include flexCenter;
  flex-direction: column;
}
// 处理结果是否满意
.res {
  display: block;
  text-align: center;
  margin: 24px 0px 10px 0px;
  font-size: 16px;
  color: #606266;
}
.btn {
  width: 240px;
  height: 44px;
  border-radius: 22px;
  border: 1px solid #2163e0;
  background-color: transparent;
  cursor: pointer;
  margin: 0 auto;
  color: #2163e0;
}
</style>

